import Vue from 'vue'
import Router from 'vue-router'
// import Home from '../components/Home.vue'
Vue.use(Router)
export default new Router({
    routes:[
        {
            path:'/',
            redirect:'/publicQuery',
            hidden:true,
            component:()=> import('@/components/drug/PublicQuery') //路由懒加载
        },
        {
            path:'/publicQuery',
            name:'/publicQuery',
            hidden:true,
            component:()=> import('@/components/drug/PublicQuery')
        },
        {
            path:'/adminQuery',
            name:'/adminQuery',
            hidden:true,
            component:()=> import('@/components/drug/AdminQuery')
        },
        {
            path:'/login',
            name:'/Login',
            hidden:true,
            component:()=> import('@/components/Login') //路由懒加载
        },
        {
            path:'*',
            name:'NotFound',
            hidden:true,
            component:()=> import('@/components/NotFound') //路由懒加载
        },
        // {
        //     path:'/home',
        //     // component:()=> import('@/components/Home') //路由懒加载
        //     component:resolve => require(['@/components/Home'],resolve) // 异步组件
        // },
 
        // 第一个
        {
            path:'/home',
            name:'车辆管理',
            redirect:'/home/bike',  //默认重定向
            component:()=> import('@/components/Home'),
            children:[
                {
                    path:'/home/bike',  
                    name:'车辆列表',
                    component:()=> import('@/components/bike/BikeList'),//这里对应文件的名字，我创建的是BikeList
                },
                {
                    path:'/home/ment',  
                    name:'车辆管理',
                    component:()=> import('@/components/bike/BikeMent'),//这里对应文件的名字，我创建的是BikeList
                },
                {
                    path:'/home/info',  
                    name:'信息列表',
                    component:()=> import('@/components/bike/InfoList'),//这里对应文件的名字，我创建的是BikeList
                }
            ]
        },
 
        // 第二个
        {
            path:'/home',
            name:'数据渲染',
            component:()=> import('@/components/Home'),
            children:[
                {
                    path:'/home/dataview',  
                    name:'数据概览',
                    component:()=> import('@/components/bikeupdate/DataView'),//这里对应文件的名字，我创建的是BikeList
                }
            ]
        }
    ],
    mode:'history'
})